﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="RelacionesAddAmenVuln.aspx.cs" Inherits="AudiPyme.UI.RelacionesAddAmenVuln" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="PanelAdministrador" runat="server">
        <ul class="list1">
            <li><a href="RelacionesAmenVuln.aspx">Gestionar Relaciones Amenaza-Vulnerabilidad</a></li>
        </ul>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Relaciones Amenaza-Vulnerabilidad<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </h2>
    <p>
    </p>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server" >
                Las relaciones han sido insertadas correctamente
                <br />
                <br />
                <asp:Button ID="btnOk" runat="server" Text="Ok" OnClick="BtnInsertar_Click" />
                <asp:Button ID="btnClose" runat="server" Text="Close Me" />
            </asp:Panel>
            <asp:Button ID="Button1" runat="server" Text="First Modal Popup" />
            <asp:ModalPopupExtender ID="Panel1_ModalPopupExtender" runat="server" BackgroundCssClass="modalBackground"
                Enabled="True" TargetControlID="BtnInsertar" PopupControlID="Panel1">
            </asp:ModalPopupExtender>
            <br />
            <h4>
                Número de Relaciones Seleccionadas:<asp:Label ID="LblControl" runat="server" CssClass="alignright"
                    Text="0" Width="30px"></asp:Label>
            </h4>
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" OnPageIndexChanging="GridView1_PageIndexChanging">
                <Columns>
                    <asp:BoundField DataField="IdAmenaza" HeaderText="IdAmenaza" />
                    <asp:BoundField DataField="Amenaza" HeaderText="Amenaza" />
                    <asp:BoundField DataField="IdVulnerabilidad" HeaderText="IdVulnerabilidad" />
                    <asp:BoundField DataField="Vulnerabilidad" HeaderText="Vulnerabilidad" />
                    <asp:TemplateField HeaderText="Opciones">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBox_Changued" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <PagerSettings Mode="NumericFirstLast" />
            </asp:GridView>
            <p>
                <asp:Button ID="BtnInsertar" runat="server" Text="Insertar" Enabled="False" OnClick="BtnInsertar_Click" />
                <asp:Label ID="LblInsertar" runat="server"></asp:Label>
            </p>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script type="text/javascript">
        function expandDetailsInGrid(_this) {
            var id = _this.id;
            var imgelem = document.getElementById(_this.id);
            var currowid = id.replace("A_View", "TR_Summmary") //Coge el Id la fila seleccionada

            var rowdetelemid = currowid;
            var rowdetelem = document.getElementById(rowdetelemid);
            if (imgelem.alt == "plus") {
                imgelem.src = "minus.gif"
                imgelem.alt = "minus"
                rowdetelem.style.display = 'block';
            }
            else {
                imgelem.src = "plus.gif"
                imgelem.alt = "plus"
                rowdetelem.style.display = 'none';
            }

            return false;

        }
        function redirigir() {
            document.getElementById("BtnInsertar").click();
            location.href = '<%= Page.ResolveUrl("~/RelacionesAdd.aspx") %>';
        }
    </script>
</asp:Content>
